package org.chipu.jnids;

import junit.framework.Assert;
import org.chipu.jnids.beans.Profile;
import org.chipu.jnids.sce.profile.*;
import org.junit.Test;

public class SerializerTester {
	@Test
	public void test() throws Exception {
		Profile p = new Profile("profile_t", true);
		// p.addStats(new StatType(StatType.Type.CONNECTIONS_OUT, (byte) 5), new Stats(5, 1.2f, 2.1f, 3,
		// 6.87f), (short) 7);
		PuntualStats ps = new PuntualStats(System.currentTimeMillis());
		ps.add(new StatType(StatType.Type.CONNECTIONS_IN, (byte) 7), new Stats(5, 1.1f, 2.2f, 3, 6f));
		p.addStats(ps);
		System.err.println(p);
		System.err.println(p.encode());
		System.err.println(Profile.decode(p.encode()));
		Assert.assertEquals(p, Profile.decode(p.encode()));
	}
}